import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';


class BuyButton extends StatefulWidget {

  final Color color;
  final String text;
  final void Function()? cb;

  const BuyButton({super.key, required this.color, required this.text,this.cb});

  @override
  State<BuyButton> createState() => _BuyButtonState();
}

class _BuyButtonState extends State<BuyButton> {

  @override
  Widget build(BuildContext context) {
    ScreenUtil.init(context, designSize: const Size(750, 1334));

    return InkWell(
      onTap: widget!.cb,
      child: Container(
        margin: EdgeInsets.all(10.w),
        padding: EdgeInsets.all(10.w),
        height: 68.h,
        width: double.infinity,
        decoration: BoxDecoration(
            color: widget.color,
            borderRadius: BorderRadius.circular(10)
        ),
        child: Center(
          child: Text(widget.text,
              style: const TextStyle(color: Colors.white)
          ),
        ),
      )
    );
  }
}
